﻿using System;
using MaLu.Data;
using Malu.WebTemplates;
using Wicresoft.Framework.Organization;

namespace MaLu.Common
{
    public class ThreePage : BaseAuthenticationPage
    {
        private IDbProvider provider = null;
        protected IDbProvider Provider
        {
            get
            {
                if (provider == null)
                {
                    provider = ProviderManager.Factory.CreateDbProvider();
                    provider.Open();
                   
                }
                return provider;
            }

        }

        private bool? _IsLeader;

        protected bool IsLeader
        { 
            get
            {
                if (!_IsLeader.HasValue)
                {
                    _IsLeader= OrganizationHelper.IsUserInRole(CurrentUser.ID, Config.ThreeLeaderRole);
                
                }
                return _IsLeader.Value;
         }
        }
      

    }
}
